package com.dhcc.core.cxf.staticWs;

public class AppServiceSoapProxy implements AppServiceSoap {
  private String _endpoint = null;
  private AppServiceSoap appServiceSoap = null;
  
  public AppServiceSoapProxy() {
    _initAppServiceSoapProxy();
  }
  
  public AppServiceSoapProxy(String endpoint) {
    _endpoint = endpoint;
    _initAppServiceSoapProxy();
  }
  
  private void _initAppServiceSoapProxy() {
    try {
      appServiceSoap = (new AppServiceLocator()).getAppServiceSoap();
      if (appServiceSoap != null) {
        if (_endpoint != null)
          ((javax.xml.rpc.Stub)appServiceSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
        else
          _endpoint = (String)((javax.xml.rpc.Stub)appServiceSoap)._getProperty("javax.xml.rpc.service.endpoint.address");
      }
      
    }
    catch (javax.xml.rpc.ServiceException serviceException) {}
  }
  
  public String getEndpoint() {
    return _endpoint;
  }
  
  public void setEndpoint(String endpoint) {
    _endpoint = endpoint;
    if (appServiceSoap != null)
      ((javax.xml.rpc.Stub)appServiceSoap)._setProperty("javax.xml.rpc.service.endpoint.address", _endpoint);
    
  }
  
  public AppServiceSoap getAppServiceSoap() {
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap;
  }
  
  public String methodExec(String aClassName, String aQueryName, String aArgCnt, String aArgStr) throws java.rmi.RemoteException{
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap.methodExec(aClassName, aQueryName, aArgCnt, aArgStr);
  }
  
  public String queryDepts(String aHospIDs, String aLocType, String start, String limit) throws java.rmi.RemoteException{
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap.queryDepts(aHospIDs, aLocType, start, limit);
  }
  
  public String queryExec(String aClassName, String aQueryName, String aArgCnt, String aArgStr) throws java.rmi.RemoteException{
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap.queryExec(aClassName, aQueryName, aArgCnt, aArgStr);
  }
  
  public String queryUsers(String hospId, String locId) throws java.rmi.RemoteException{
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap.queryUsers(hospId, locId);
  }
  
  public String test() throws java.rmi.RemoteException{
    if (appServiceSoap == null)
      _initAppServiceSoapProxy();
    return appServiceSoap.test();
  }
  
  
}